import React from "react"
import { Redirect, Switch, Route } from "react-router-dom"
// import loadable from "../loadable"
class oAuth extends React.Component {
    render() {
        console.log(this.props)
        let flag = window.sessionStorage.getItem("islogin")//假数据 代表是否登录过,真实项目是取缓存
        if (!flag) { return <Redirect to="/login"></Redirect> }
        else {
            return <Route path={this.props.path} component={this.props.component}></Route>
        }
    }
}
export default oAuth